import java.util.ArrayList;
import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description：
 * User：user
 * DATE:2021-11-02
 * Time:15:29
 */
public class TestDemo {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        //Ctrl 点击查看原码
        //alt + 7 查看原码中的各种方法
        stack.push(1);//入栈
        stack.push(2);
        stack.push(3);
        stack.push(4);
        int ret = stack.pop();//出栈删除栈顶元素
        System.out.println(ret);
        System.out.println(stack.peek());//查看栈顶元素
        System.out.println(stack.empty());
    }
}
